
#ifndef SOUNDS_H_
#define SOUNDS_H_

#include "soundbank.h"
#include "soundbank_bin.h"
#include "sounds.h"

#define AMBU 0
#define BOOM 1

typedef struct {
	int musictype;
	int volumechanging;
	int volume;
	bool playing;
	int frames;
} musicStruct;

bool maxModInit = false;
musicStruct music;

void initSounds() {
	mmInitDefaultMem( (mm_addr)soundbank_bin );
	mmLoadEffect( SFX_AMBU );
	mmLoadEffect( SFX_BOOM);
	maxModInit=true;
/*int i;
for (i=0;i<MSL_NSAMPS;i++)mmLoadEffect(i); //loads all sfx
for (i=0;i<MSL_NSONGS;i++)mmLoad(i); //loads all songs
	//music.musictype=rand()%MSL_NSONGS;//randomly choose a song
	//music.volume=0;
	//music.playing=false;
	//music.frames=0;
	//music.volumechanging=0; //0 for no changing, 1 for fade in, 2 for fade out..
	maxModInit=true;*/
}

void playSound(int sound) {
	if (maxModInit==false) initSounds();
	switch(sound) {
	case AMBU:
		mmEffect(SFX_AMBU);
		break;
	case BOOM:
		mmEffect(SFX_BOOM);
		break;
	}
}

void playMusic(int music) {
	if (maxModInit == false) initSounds();
	switch(music) {

	}
}

void stopMusic() {
	mmStop();
}

#endif /* SOUNDS_H_ */
